Artur Almeida, Brenda Assis, Eraldo Jair e Rafael Yui
24 de agosto de 2022
setwd("C:/Users/erald/OneDrive/Área de Trabalho/eraldo-bkp/== U N B - E S T A T/-=2022.1=-/CE2 - R/=SEMINÁRIO/QUICKBIRD - BRASILIA")
library(raster)## Carregando pacotes exigidos: sp
## Please note that rgdal will be retired by the end of 2023,
## plan transition to sf/stars/terra functions using GDAL and PROJ
## at your earliest convenience.
##
## rgdal: version: 1.5-32, (SVN revision 1176)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.4.3, released 2022/04/22
## Path to GDAL shared files: C:/Users/erald/AppData/Local/R/win-library/4.2/rgdal/gdal
## GDAL binary built with GEOS: TRUE
## Loaded PROJ runtime: Rel. 7.2.1, January 1st, 2021, [PJ_VERSION: 721]
## Path to PROJ shared files: C:/Users/erald/AppData/Local/R/win-library/4.2/rgdal/proj
## PROJ CDN enabled: FALSE
## Linking to sp version:1.5-0
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
########## ABRIR IMAGEM DE SATÉLITE - SELEÇÃO DE BANDAS MULTIESPECTRAIS ########
r = raster("qb_05jun.tif",band = 3) # Vermelho
g = raster("qb_05jun.tif",band = 2) # Verde
b = raster("qb_05jun.tif",band = 1) # azul
ir= raster("qb_05jun.tif",band = 4) # infravermelho
rgb=brick(b,g,r)
plotRGB(rgb, r=3, g=2, b=1 , stretch='lin')## class : RasterLayer
## band : 3 (of 4 bands)
## dimensions : 4096, 3238, 13262848 (nrow, ncol, ncell)
## resolution : 2.4, 2.4 (x, y)
## extent : 188143.2, 195914.4, 8244826, 8254656 (xmin, xmax, ymin, ymax)
## crs : +proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs
## source : qb_05jun.TIF
## names : qb_05jun
## values : 0, 65535 (min, max)
## class : RasterLayer
## dimensions : 4096, 3238, 13262848 (nrow, ncol, ncell)
## resolution : 2.4, 2.4 (x, y)
## extent : 188143.2, 195914.4, 8244826, 8254656 (xmin, xmax, ymin, ymax)
## crs : +proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs
## source : memory
## names : layer
## values : -0.993921, 0.9947368 (min, max)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:raster':
##
## intersect, select, union
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library("rayshader")
loadzip = tempfile()
download.file("https://tylermw.com/data/dem_01.tif.zip",loadzip)
localtif=unzip(loadzip, 'dem_01.tif') %>% raster()
unlink(loadzip)
rast.mat = raster_to_matrix(localtif)
rast.mat %>%
sphere_shade(texture = 'desert') %>%
plot_map()#visualização 3d
rast.mat %>%
sphere_shade(texture = 'desert') %>%
add_water(detect_water(rast.mat), color='desert')%>%
#add_shadow(ray_shade(rast.mat, zscale = 3),0.5) %>%
#add_shadow(ambient_shade(rast.mat),0)%>%
plot_3d(rast.mat, zscale = 10, fov=0, theta = 135,
zoom = 0.75, phi = 45, windowsize = c(1000,800))
render_snapshot()setwd("C:/Users/erald/OneDrive/Área de Trabalho/eraldo-bkp/== U N B - E S T A T/-=2022.1=-/CE2 - R/=SEMINÁRIO/=ANAGLIFOS")
library(raster)
library(rgdal)
r1 = raster("carta_red.jpg",band = 1)
g2 = raster("carta_cyan.jpg",band = 2)
b2 = raster("carta_cyan.jpg",band = 3)
rgb=brick(r1,g2,b2)
plotRGB(rgb, r1=1, g2=2, b2=3 , stretch='lin', maxpixels=1000000)## Warning in plot.window(...): "r1" não é um parâmetro gráfico
## Warning in plot.window(...): "g2" não é um parâmetro gráfico
## Warning in plot.window(...): "b2" não é um parâmetro gráfico
## Warning in plot.xy(xy, type, ...): "r1" não é um parâmetro gráfico
## Warning in plot.xy(xy, type, ...): "g2" não é um parâmetro gráfico
## Warning in plot.xy(xy, type, ...): "b2" não é um parâmetro gráfico
## Warning in title(...): "r1" não é um parâmetro gráfico
## Warning in title(...): "g2" não é um parâmetro gráfico
## Warning in title(...): "b2" não é um parâmetro gráfico
## Warning in graphics::rasterImage(z, bb[1], bb[3], bb[2], bb[4], interpolate =
## interpolate, : "r1" não é um parâmetro gráfico
## Warning in graphics::rasterImage(z, bb[1], bb[3], bb[2], bb[4], interpolate =
## interpolate, : "g2" não é um parâmetro gráfico
## Warning in graphics::rasterImage(z, bb[1], bb[3], bb[2], bb[4], interpolate =
## interpolate, : "b2" não é um parâmetro gráfico